package com.abel.web.view;

import java.util.List;

import com.abel.domain.UserRole;
import com.abel.util.UserSessionLocator;
import com.abel.util.UserTypeEvaluator;

public abstract class BaseViewBean {
	

	/**
	 * @return the salutation
	 */
	public String getSalutation() {
		
		return UserSessionLocator.getUserSession().getAuthPrincipal() != null ? 
				"Welcome " + UserSessionLocator.getUserSession().getAuthPrincipal().getUserName()
				: "";
	}

	public boolean isAdmin() {
		
			return UserTypeEvaluator.isAdmin();
	}
	
	
	public boolean isSuperAdmin() {
		
		return UserTypeEvaluator.isSuperAdmin();
	}

	
	public boolean isAnyAdmin() {
		
		return UserTypeEvaluator.isAdmin() || UserTypeEvaluator.isSuperAdmin();
	}
}
